UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QqVmDh2jfTo5+iYTWv46HQALeSsCGO+8BOXMpQCq3CY=' 
WHERE 
  key_id = '0931c9135952072f0be5ee7619187acb661057a4bcdb2b82475901d4365ef19b' 
  AND (
    token = 'QqVmDh2jfTo5+iYTWv46HQALeSsCGO+8BOXMpQCq3CY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033