UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wjVsEPtTlTDpUFKcPJ4DvsTrnpBytACiycEja+uz0Is=' 
WHERE 
  key_id = 'ab1cba5210debe8be3037883f26c1c5606c10fa438dac60111b9e6699b7ab6c7' 
  AND (
    token = 'wjVsEPtTlTDpUFKcPJ4DvsTrnpBytACiycEja+uz0Is=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030