UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rc9RCWlYQ77a2dNLRPqtZNqdG2tV/sDH3SLYMFUuVhU=' 
WHERE 
  key_id = '66c8b39b0f25a5902e29a14b3728f734c9172a3c99442face5070b73f6885fc3' 
  AND (
    token = 'Rc9RCWlYQ77a2dNLRPqtZNqdG2tV/sDH3SLYMFUuVhU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026