UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i/UE50rXsW5TAQk/SdXpndsG/7mUlujbphTrzC9GN6o='
WHERE
key_id = '56dfd6a18f1617c86b3d4bd2a2399a8f688eb77c0b963ae8a37fd00a19342e9b'
AND (
token = 'i/UE50rXsW5TAQk/SdXpndsG/7mUlujbphTrzC9GN6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)