UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RcuPhaNhUbi9ptNUBsocRflc5cPhOudrUQG5Dhxc+WU=' 
WHERE 
  key_id = 'c9925d247fa944078251273d0c81af4b6ef0cd52da1a81cfa6c9038b6fb782d2' 
  AND (
    token = 'RcuPhaNhUbi9ptNUBsocRflc5cPhOudrUQG5Dhxc+WU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024