UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bgCFxJFlk68FNYFUUrUZlbbZ59MAJisAi5V3Cdm13a8='
WHERE
key_id = '49988ad03c128cb76b99489e39afc14d534430f115355d9b8118f79be2b252a4'
AND (
token = 'bgCFxJFlk68FNYFUUrUZlbbZ59MAJisAi5V3Cdm13a8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)