UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WcRii+NiZS9rzqYQOObErY33oti+I5JzrdwpQPkClgY=' 
WHERE 
  key_id = '1a8e2734a550ed4cdca74fa346b5e1040fe7bc7783bcab871229a3f71d3a2061' 
  AND (
    token = 'WcRii+NiZS9rzqYQOObErY33oti+I5JzrdwpQPkClgY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045