UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wA84Tgk8k14YsLHgg72AnZbe748H+jENZMYM+bnj0VA='
WHERE
key_id = '0b8bc7077a6a195eaeaac0a898b8c5b3a695583553029191c6395dd33705dfd4'
AND (
token = 'wA84Tgk8k14YsLHgg72AnZbe748H+jENZMYM+bnj0VA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)