UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rQ6wIqk2KCgWD0A2R2ltOp+sd82KRGXnZp0wb/h6Vpw='
WHERE
key_id = '5f6ecd157e2c493fff73372725c3ccb2f058cf6b238ba298d78ae939fdb3d918'
AND (
token = 'rQ6wIqk2KCgWD0A2R2ltOp+sd82KRGXnZp0wb/h6Vpw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)