UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PN1EB4j8WR+xm1kenWe2ZZcFv27eGckCZ/omDH17VHw='
WHERE
key_id = 'db22e0dbd0f26cba9eee210e24fd00db9d1a3355e7f386603fc6607c715ef4e3'
AND (
token = 'PN1EB4j8WR+xm1kenWe2ZZcFv27eGckCZ/omDH17VHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)