UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/SL+QCGEY3hfkPu5Pv08T/dh52EtOLd4m/CAiSJ2DIg='
WHERE
key_id = 'ce7b68bfc0b1fba32bea334aec2abea4ebba8197ce8bb47d26b1b089fd6059fd'
AND (
token = '/SL+QCGEY3hfkPu5Pv08T/dh52EtOLd4m/CAiSJ2DIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)