UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0ne4ulR8CZA+WTAyWVCmC6/N4uADYkOySB0mMHKISqc='
WHERE
key_id = '2576c4d5cc2b3d9ea645e38302b0dbd7df31573b575d2af03ec49ed7640bfdd8'
AND (
token = '0ne4ulR8CZA+WTAyWVCmC6/N4uADYkOySB0mMHKISqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)