UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HnTknx5k+mOIbzdbA9JPl5mykT0KiPfFjuog4Hm+FJU='
WHERE
key_id = '03cf1886313752c9b42cbdc13b2eb740c9267143da2221c1c851c79275eb9cf9'
AND (
token = 'HnTknx5k+mOIbzdbA9JPl5mykT0KiPfFjuog4Hm+FJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)