UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AYR/CCg634IFtYBGERALms3OIOBizu9k+suv/DHFF7k='
WHERE
key_id = 'fffa33dd8b67c7b910f3d16cd5a298ca8149ee9071f3bdb952250c40721c665b'
AND (
token = 'AYR/CCg634IFtYBGERALms3OIOBizu9k+suv/DHFF7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)