UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PuFZ8Jh6JjtG6dC5Lp0ZPunUr6x+8mThmgoz11B4tFY='
WHERE
key_id = '1b57e76009bdbaabeb16183ef33f42712468ad5df6a736f9a7a597531f88dd66'
AND (
token = 'PuFZ8Jh6JjtG6dC5Lp0ZPunUr6x+8mThmgoz11B4tFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)