UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kB1ncuoGuyn1k0cpY0IPa4E9wXLdKnkeky/IijXYxu0='
WHERE
key_id = '56e867b2c910b0c304dd2a7785833bba55b60a7fb5826441295d37160f277235'
AND (
token = 'kB1ncuoGuyn1k0cpY0IPa4E9wXLdKnkeky/IijXYxu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)