UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+l7MVQwAxUgYMmL6UABPLnIVZqyEtlqspTJ7qlUatHs='
WHERE
key_id = 'b5582ce4038409bca1eb0212faed2811e9517e12abe445821cc8abc412eed0e6'
AND (
token = '+l7MVQwAxUgYMmL6UABPLnIVZqyEtlqspTJ7qlUatHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)