UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eVkL5eMf+7AAGgBWX9DXgzMreEKauMDd9IY1GoYag6E='
WHERE
key_id = 'e822c6e3993a5d37afaae82cf1d839b615a271f955d9db8ca029d8ed9cc4b7e2'
AND (
token = 'eVkL5eMf+7AAGgBWX9DXgzMreEKauMDd9IY1GoYag6E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)