UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UnfYt1DsqDUvcHEG7zkOfz9ESzh2jMpsuEODhx4Q74A=' 
WHERE 
  key_id = 'a441c0a78438de4ff6bd7e6239b45da3a20dcd3aa3e62c26b1d59caa72d75f19' 
  AND (
    token = 'UnfYt1DsqDUvcHEG7zkOfz9ESzh2jMpsuEODhx4Q74A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022