UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I/nDrvr9BiqEtfs76JIQ+wAU8EQnDvgt8lupcuFDCaA='
WHERE
key_id = 'ae6791ac8bb95bb28dfb6e0eecc6307238f0d6b34643cd6c9afc2fcde64ed2fe'
AND (
token = 'I/nDrvr9BiqEtfs76JIQ+wAU8EQnDvgt8lupcuFDCaA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)