UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RhDMjSakEmEZhG5+wUtDz+6g6V5e7GIWKW24AzXdtMw='
WHERE
key_id = 'b2127f6c14cfec7773e18efef0d7872df719e5063db00c9d5fc08b4b32c92aa9'
AND (
token = 'RhDMjSakEmEZhG5+wUtDz+6g6V5e7GIWKW24AzXdtMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)