UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EBylvR/RpzT0W2FJeXVwzdCdIHWF9MuE4iezoIKNc1o='
WHERE
key_id = 'c4d17d4450415cc669dfa1c9c2b340797de9a7208c2494a59b638451cbe22443'
AND (
token = 'EBylvR/RpzT0W2FJeXVwzdCdIHWF9MuE4iezoIKNc1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)