UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uXlxTN/AW1/Sk4w8FH36sdS+gHvDalda1J46hJnmE1k=' 
WHERE 
  key_id = '58008ac27d8d00116f98cd75cd252738148ff43a07dc2cabc24aab3ded26ac9d' 
  AND (
    token = 'uXlxTN/AW1/Sk4w8FH36sdS+gHvDalda1J46hJnmE1k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032