UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mQ089E313QXogv0qo8vU3CxdojdqZ7fMtyYA5pL71e8='
WHERE
key_id = '66aaacbfc420db1ab1c978fbffbdfff500ad085ccb40aed580703be0e6370a5a'
AND (
token = 'mQ089E313QXogv0qo8vU3CxdojdqZ7fMtyYA5pL71e8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)