UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B3ep7iXLZxHIQl9kzk+Ld/9fyxnVAEdcAJbBtVB3fLc=' 
WHERE 
  key_id = 'a0bb16a8db338bc29432aaaacf1b15bd1adceb752c54fa3bbdf2520b89834fa0' 
  AND (
    token = 'B3ep7iXLZxHIQl9kzk+Ld/9fyxnVAEdcAJbBtVB3fLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029