UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pMPxcD4fVX6ZH//ZEcMyZ60344HavMfpCW1OLg3QRgs=' 
WHERE 
  key_id = 'def5f3b60b09467fb080c74bbb57f46ffee7f4a9b9fd3ce0346a41435f7e7976' 
  AND (
    token = 'pMPxcD4fVX6ZH//ZEcMyZ60344HavMfpCW1OLg3QRgs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033