UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8o1Vmc1oprcAw3L4Es4H4TJYE/OmMAzzie+cy7F1FBI=' 
WHERE 
  key_id = 'f627caa49ecf396be936eb1cabe2037978e70de45ef987b624e80bf74b61d286' 
  AND (
    token = '8o1Vmc1oprcAw3L4Es4H4TJYE/OmMAzzie+cy7F1FBI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043