UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kMONqocKQQLEtPzo2ts77ZfXANc3DtE5KQPp/A+2UFc=' 
WHERE 
  key_id = '84a2e7c0fd83791eeed6c4f85fca7fbb70080a02c0376cedb6446b371a76a19e' 
  AND (
    token = 'kMONqocKQQLEtPzo2ts77ZfXANc3DtE5KQPp/A+2UFc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039