UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9sZ+fVEWdpjNO//4Gh4p0rhzvDhB6IrIKx0r125zt2A=' 
WHERE 
  key_id = '7b564ac179c9a6593ec6b8b7b7fb3a27d66f2e7ce4c4f630dc715db9445c4c84' 
  AND (
    token = '9sZ+fVEWdpjNO//4Gh4p0rhzvDhB6IrIKx0r125zt2A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017