UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EridEnjJSYlwqTcshcD96IQruKmKEpH+q1n5xBIcakg='
WHERE
key_id = 'bc7f1d6a519e5f174de86775b4976b8150a0a7a43fa427e0e30bf916070c1973'
AND (
token = 'EridEnjJSYlwqTcshcD96IQruKmKEpH+q1n5xBIcakg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)