UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5WLVAEBCBSId+dftn0prjgxNS7vEEVP/XCpCten5KXw='
WHERE
key_id = 'e481be29421fb89661bb74621f9932e9b1472820591e3c2ca3e179b0d2b2a2f8'
AND (
token = '5WLVAEBCBSId+dftn0prjgxNS7vEEVP/XCpCten5KXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)