UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oTWAW+yJ75tFbvONWiuIl81RevQooE5pOd9ZlnzVV9s='
WHERE
key_id = '68349b33c7ca4e3d648545632c058248c654036d9ebe1bf23a5615d9f60d013e'
AND (
token = 'oTWAW+yJ75tFbvONWiuIl81RevQooE5pOd9ZlnzVV9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)