UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KtZF9Lc5fx6Ws8GDeLZf1Lk2clK93tRDXPLcQ0u0vec='
WHERE
key_id = 'e482fa911de7306a2736aa8470366123ad1f33ad639bc7fee577046e6ce5f3c9'
AND (
token = 'KtZF9Lc5fx6Ws8GDeLZf1Lk2clK93tRDXPLcQ0u0vec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)