UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+hKDh9TtStCPG1Ia5Fy40FhN7QWpftWy1gvbDX8A0kE='
WHERE
key_id = '6379a9afba8b4c82bd0fccb7f3d2cdca6ddf886973dc58f8cb8e9e923d4de8ad'
AND (
token = '+hKDh9TtStCPG1Ia5Fy40FhN7QWpftWy1gvbDX8A0kE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)