UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rtOTRb4Ps0cl7oj3GaVCDEuJ/maaDSPGXmKIryfGsBA='
WHERE
key_id = '20e80284decc82863f02e38eb3dd6f632cbe9f63688e2c8bce1707ae3bd612a7'
AND (
token = 'rtOTRb4Ps0cl7oj3GaVCDEuJ/maaDSPGXmKIryfGsBA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)