UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v8Vim7p6hHZvr06ypGLpJso6IPaPj3QKBFVAkfle/1c='
WHERE
key_id = '013dae3da6831bb211a6655dc6607cd7fc81cf04e6897ebfc2908ba21ba983fe'
AND (
token = 'v8Vim7p6hHZvr06ypGLpJso6IPaPj3QKBFVAkfle/1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)