UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hk/8GxArs881FQ69rajuwl8TaukvR96i3q4s6G9a8pg='
WHERE
key_id = '9a2789b1a4552816b3e58384e47b04b65579d6027fa3bdc0c556a8f894e2442f'
AND (
token = 'hk/8GxArs881FQ69rajuwl8TaukvR96i3q4s6G9a8pg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)