UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '66qPQQgL1+wi21ele2SN9M2IIXeOoogaJbP+t/n6lak=' 
WHERE 
  key_id = '53e9dd6d292d9878b6ace1864a8b679c4241e4adeab3907d7c282d20a6695499' 
  AND (
    token = '66qPQQgL1+wi21ele2SN9M2IIXeOoogaJbP+t/n6lak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016