UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'akL1tqbHmWMLQjfBIHwqIsOVB2moEYm1nOfSOp5YWKw='
WHERE
key_id = '19410b8445a0f5336914c3d17778eef2ddcef38007036183faec7c8e55f3fd40'
AND (
token = 'akL1tqbHmWMLQjfBIHwqIsOVB2moEYm1nOfSOp5YWKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)