UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iNVkVBbwthnwV9VXFE+95Qm/Uhw5Dzrq+hAWZ9dSHDA='
WHERE
key_id = '2b1c22f4b0d9c5ad94bd1243c6294722d3af6ca7f9ace4a7e7afb331c04bba4d'
AND (
token = 'iNVkVBbwthnwV9VXFE+95Qm/Uhw5Dzrq+hAWZ9dSHDA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)