UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K365fVbeRh/pFpEji8lkvhtYPxrI2gqaCL6X40DFsAQ=' 
WHERE 
  key_id = '71a1c5a614cd581befcdc74f9eadb7946429f79660370b8562ef20dd7b88550c' 
  AND (
    token = 'K365fVbeRh/pFpEji8lkvhtYPxrI2gqaCL6X40DFsAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00123