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