UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+4fwElO1r9KRls0FB4TbcuDnWwBxXf/cE54HT3LJ3jI=' 
WHERE 
  key_id = '78da88b8cf9d2cbc80ca6e81a4a039594a6e3c88712db3f3b0ade4c09a7c0461' 
  AND (
    token = '+4fwElO1r9KRls0FB4TbcuDnWwBxXf/cE54HT3LJ3jI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040